 function checkAnswer(num)
    {
        var element = document.getElementById('answer');


        if(num==256)
              {
              element.style.border = "1px solid #000";
              element.innerHTML = "You are correct! There are two choices per option: <span style='color: red;'>Selected</span> and ";
              element.innerHTML += "<span style='color: red'>Unselected</span>. <br /><br />Since there are 8 options, with 2 choices each, we have 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2,2<sup>8</sup>, or 256  configurations.";
              }
         else
               {
               element.innerHTML = num + " is not the right answer. <br /><br />To find the answer,count the number of choices for each option and multiply the number of choices from all options together."
               }

    }

 function checkOA(num)
    {
        var element = document.getElementById('answer');

         if(num==4)
              {
                   element.innerHTML = "Correct, N = 16, s = 2 for k = 6 columns and s = 4 for k = 3 columns with strength 2.";
              }
        else if(num==1)
               {
		   element.innerHTML = "Incorrect, remember that N represents the number of rows";
               }
       else if(num==2)
               {
		   element.innerHTML = "Incorrect, how many columns contain just 2 values?";
               }
       else if(num==3)
               {
		   element.innerHTML = "Incorrect, look at the values of k and the total number of columns in the Mixed Orthogonal Array";
               }
       else if(num==5)
               {
		   element.innerHTML = "Incorrect, remember the index is found by &#955=N/s<sup>t</sup>, what value do you get if t is equal to 3 and s is equal to 4? ";
               }

    }


  function next_step()
    {
        var i = 1;
        var frame = document.getElementById(i);
        document.getElementById('back_float').style.visibility="visible";
	while(frame)
		{
		if(frame.style.display == 'block')
			{
			make_visible = document.getElementById(i + 1);
			if(make_visible)
				{
				frame.style.display = 'none';
				make_visible.style.display = 'block';
				}
                            i = i + 2;
                            frame = document.getElementById(i);
                            if(!frame)
                                document.getElementById('forward_float').style.visibility="hidden";
			break;
			}
		i = i + 1; 
		frame = document.getElementById(i);
		}
    }

 function page()
    {
        var i = 1;
        var check = <?=$_GET['start']?>;
        if(check == i){
        var frame = document.getElementById(i);
	make_visible = document.getElementById(check);
	frame.style.display = 'none';
	make_visible.style.display = 'block';
    } 
        else{
        var frame = document.getElementById(i);
	make_visible = document.getElementById(check);
	frame.style.display = 'none';
	make_visible.style.display = 'block';
        document.getElementById('back_float').style.visibility="visible";
	}
    }

function back_step()
    {
	var i = 1;
	var frame = document.getElementById(i);
	while(frame)
		{
		if(frame.style.display=='block')
			{
			make_visible = document.getElementById(i-1);
			if(make_visible)
				{
				frame.style.display = 'none';
				make_visible.style.display = 'block';
                                document.getElementById('forward_float').style.visibility="visible";
				}
                            if(i==2) document.getElementById('back_float').style.visibility="hidden";
			break;
			}
		i = i + 1; 
		frame = document.getElementById(i);
		}

    }

